package com.moli.iov.protocol.enums.extend;

import com.moli.iov.protocol.enums.IDictsEnumTag;

/**
 * 扩展数据 - 手刹状态
 * 
 **/

public enum ExtendHandBrakeStateTag implements IDictsEnumTag{
	
	/**
	 * 拉起
	 */
	ON("拉起", (byte) 0x00), 
	/**
	 * 未拉起
	 */
	OFF("未拉起", (byte) 0x01);

	private ExtendHandBrakeStateTag(String key, byte value) {
		this.k = key;
		this.v = value;
	}

	private String k;

	private byte v;

	public ExtendHandBrakeStateTag valueOf(byte value) {
		switch (value) {
		case 0x00:
			return ON;
		case 0x01:
			return OFF;
		default:
			return null;
		}
	}

	public static String getKey(byte value) {
		for (ExtendHandBrakeStateTag c : ExtendHandBrakeStateTag.values()) {
			if (c.getV() == value) {
				return c.k;
			}
		}
		return null;
	}

	@Override
	public String getK() {
		return k;
	}

	@Override
	public byte getV() {
		return v;
	}
	
}
